﻿#include "customer.h"

#include <QDebug>

#include "apple.h"
#include "book.h"

Customer::Customer() : Visitor()
{

}

void Customer::visit(Book *book)
{
    qDebug() << book->name() << " price: " << book->price();
}

void Customer::visit(Apple *apple)
{
    qDebug() << apple->name() << " price: " << apple->price();
}

void Customer::setNum(Book *book, int count)
{
    qDebug() << "add " << count << "of" << book->name() << "into shopping cart";
    book->setNumber(count);
}

void Customer::setNum(Apple *apple, int count)
{
    qDebug() << "add " << count << "of" << apple->name() << "into shopping cart";
    apple->setNumber(count);
}
